<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><{:C('site_name')}></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">

<script type="text/javascript" src="<{:STATICS}>/js/jquery.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/regExp.js"></script>
<script type="text/javascript" src="<{:RES}>/js/common.js"></script>

<link rel="stylesheet" href="<{:STATICS}>/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="<{:STATICS}>/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="<{:RES}>/css/global.css" media="all">
<script>
$(function(){
	//ajaxform
	var options = { 
		dataType:'json',
		beforeSubmit:showRequest,//表单验证方式
        success:showResponse  // post-submit callback 
    }; 

    $('#iframForm').ajaxForm(options); 

    function showResponse(responseText, statusText)  {
    	$('#iframForm button').removeAttr('disabled');
    	$('#iframForm input').removeAttr('disabled');
		if (statusText == 'success') {
			parent.layer.close(load);
			if (responseText.status==1) {
				parent.layer.open({
					type:0, 
					icon:1,
					content:responseText.info,
					time:3000,
					end: function(){ 
						var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
						parent.layer.close(index);
						parent.location.reload();
					} 
				});
			}else{
				parent.layer.open({
					type:0, 
					icon:2,
					content:responseText.info
				});
			}
		}else{
			parent.layer.msg('服务器错误');
		}
	} 

	function showRequest(){
		$('#iframForm button').attr("disabled","disabled");
		$('#iframForm input').attr("disabled","disabled");
		load = parent.layer.load(0,{shade: [0.7, '#000000']});
	}
})
</script>

</head>
<body>
<div class="iframeBox">	
	<fieldset class="layui-elem-field">
		<legend><{$subject.name}></legend>
		<div class="layui-field-box">
			<form id="ajaxForm" method="post" action="<{:U('Question/del')}>">
			<table class="site-table table-hover">
				<thead>
					<tr>
						<th><input type="checkbox" id="selected-all"></th>								
						<TH>问题名称</TH>
						<TH>票数</TH>  
						<TH>排序</TH> 
						<TH>添加日期</TH>
						<TH>更新日期</TH>
						<TH>操作</TH>
					</tr>
				</thead>
				<tbody>
					<volist name="list" id="vo">
					<tr>
						<td><input type="checkbox" name="selectedids[]" value="<{$vo.id}>"></td>
						<td><{$vo.name}></td>
						<td><{$vo.poll}></td>
						<td><{$vo.sort}></td>	  
						<td><{$vo.createTime|date='Y-m-d H:i:s',###}></td>
						<td><{$vo.updateTime|date='Y-m-d H:i:s',###}></td>
						<td>
						<a href="<{:U('Question/edit' , array('id'=>$vo['id']))}>" class="layui-btn layui-btn-mini">编辑</a>
						</td>						
					</tr>	
					</volist>						
				</tbody>
			</table>
			</form>
		</div>
	</fieldset>
	<p>
		<a href="<{:U('Question/add',array('sid'=>$subject['id']))}>" class="layui-btn layui-btn-small">
			<i class="layui-icon">&#xe608;</i> 添加
		</a>
		<button class="layui-btn layui-btn-small layui-btn-danger" id="delBtn">
			<i class="fa fa-close"></i> 删除
		</button>
	</p>
</div>

</body>
</html>